package net.qiqbframework.spring.aggregate;


import net.qiqbframework.config.AggregateConfigurer;
import net.qiqbframework.config.Configurer;
import net.qiqbframework.config.ConfigurerModule;

import javax.annotation.Nonnull;

public class GeneralAggregateConfigurer<A> implements ConfigurerModule {

    private final Class<A> aggregateType;

    private final String aggregateName;


    public GeneralAggregateConfigurer(Class<A> aggregateType, String aggregateName) {

        this.aggregateType = aggregateType;

        this.aggregateName = aggregateName;
    }


    @Override
    public void configureModule(@Nonnull Configurer configurer) {
        AggregateConfigurer<A> aggregateConfigurer = AggregateConfigurer.defaultConfiguration(aggregateType);
        configurer.registerModule(aggregateConfigurer);
    }

}
